package org.megha.blog.example.selenium.yahoo;

import java.util.List;

import com.beust.jcommander.internal.Lists;
import com.thoughtworks.selenium.Selenium;

public class SearchResultsPage implements Page {

	private static final String LOCATION_HINT = "search.yahoo.com/search";
	
	private final Selenium selenium;

	public SearchResultsPage(Selenium selenium) {
		this.selenium = selenium;
	}

	// highly crude; not recommended
	public String getSearchResultPageText() {
		return selenium.getBodyText();
	}
	
	public String getTotalResultCount() {
		return selenium.getText("id=resultCount");
	}

	@Override
	public boolean isOnThisPage() {
		return selenium.getLocation().contains(LOCATION_HINT);
	}
}
